<template>
  <view
    class="reader__loading"
    :style="{ background: themeConfig.pageBackground }"
  >
    <!-- #ifdef H5 -->
    <skeleton
      animate
      title
      title-width="90%"
      title-right
      :row="2"
      :loading="true"
      :bg-color="themeConfig.menuBackground"
    />
    <skeleton
      animate
      title
      title-width="90%"
      title-right
      :row="3"
      :loading="true"
      :bg-color="themeConfig.menuBackground"
    />
    <skeleton
      animate
      title
      title-width="90%"
      title-right
      :row="4"
      :loading="true"
      :bg-color="themeConfig.menuBackground"
    />
    <skeleton
      animate
      title
      title-width="90%"
      title-right
      :row="3"
      :loading="true"
      :bg-color="themeConfig.menuBackground"
    />
    <skeleton
      animate
      title
      title-width="90%"
      title-right
      :row="2"
      :loading="true"
      :bg-color="themeConfig.menuBackground"
    />
    <!-- #endif -->
    <view class="reader__loading-main">
      <view class="reader__loading-icon">
        <view class="one reader__loading-icon-item"></view>
        <view class="two reader__loading-icon-item"></view>
        <view class="three reader__loading-icon-item"></view>
        <view class="four reader__loading-icon-item"></view>
        <view class="five reader__loading-icon-item"></view>
      </view>
      <view class="reader__loading-text ellipsis">获取内容中</view>
    </view>
  </view>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  computed: {
    ...mapGetters(['themeConfig']),
  },
};
</script>

<style lang="scss">
.reader__loading {
  display: flex;
  flex-flow: column nowrap;
  justify-content: space-between;
  align-items: center;
  min-height: 100vh;
  padding: 30rpx 30rpx;
  box-sizing: border-box;

  &-main {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200rpx;
    height: 200rpx;
    border-radius: 20rpx;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
  }

  &-icon {
    width: auto;
    height: 60rpx;
    color: #fff;

    &-item {
      display: inline-block;
      vertical-align: middle;
      -webkit-animation: jump-animation 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78);
      animation: jump-animation 0.9s -0.5s infinite cubic-bezier(0.11, 0.49, 0.38, 0.78);
      width: 4rpx;
      height: 48rpx;
      background: #fff;
      margin-right: 8rpx;
    }

    &.five {
      margin-right: 0;
    }
  }

  &-text {
    color: #fff;
    font-size: 26rpx;
    margin-top: 20rpx;
    padding: 0 20rpx;
  }
}

.reader__loading-icon-item.tow,
.reader__loading-icon-item.four {
  -webkit-animation-delay: -0.25s !important;
  animation-delay: -0.25s !important;
}

.reader__loading-icon-item.one,
.reader__loading-icon-item.five {
  -webkit-animation-delay: 0s !important;
  animation-delay: 0s !important;
}
</style>
